
// Student类
public class Student {
    private int id; // 学号
    private String name; // 姓名
    private int javaScore; // java成绩
    private int mathScore; // math成绩

    // 构造方法
    public Student(String name, int javaScore, int mathScore) {
        this.name = name;
        this.javaScore = javaScore;
        this.mathScore = mathScore;
    }

    // getters and setters
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public int getJavaScore() {
        return javaScore;
    }

    public int getMathScore() {
        return mathScore;
    }

    // 重写toString方法，用于显示学生信息
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", javaScore=" + javaScore +
                ", mathScore=" + mathScore +
                '}';
    }
}
